import request from "@/utils/request";

export default {
  getGoodsRemarkList() {
    return request({
      url: "/goodsSign/list",
      method: "get",
    });
  },

  getGoodsRemarkById(id) {
    return request({
      url: `/goodsSign/${id}`,
      method: "get",
    });
  },

  addReamk(goodsRemark) {
    // 处理订单的时间
    return request({
      url: "/goodsSign",
      method: "post",
      data: goodsRemark,
    });
  },

  updateRemak(goodsRemark) {
    return request({
      url: `/goodsSign`,
      method: "put",
      data: goodsRemark,
    });
  },

  deleteRemarkById(id) {
    return request({
      url: `/goodsSign/${id}`,
      method: "delete",
    });
  },

  // 更新备注状态
  updateStatusSing(id) {
    return request({
      url: `/goodsSign/updateStatus/${id}`,
      method: "put",
    });
  },
  // 更新备注状态
  getIsSignFlag(oodNum) {
    return request({
      url: `/goodsSign/isSign`,
      method: "get",
      params: { oodNum: oodNum },
    });
  },

  saveRemark(goodsRemark) {
    if (goodsRemark.id == null && goodsRemark.id == undefined) {
      return this.addReamk(goodsRemark);
    }
    return this.updateRemak(goodsRemark);
  },
};
